# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=pomo
pkgver=0.8.1
pkgrel=13
pkgdesc="Pomodoro CLI"
url="https://kevinschoon.github.io/pomo/"
license="MIT"
arch="all"
makedepends="go scdoc sqlite-dev"
subpackages="$pkgname-doc"
source="https://github.com/kevinschoon/pomo/archive/$pkgver/pomo-$pkgver.tar.gz"

export GOFLAGS="$GOFLAGS -trimpath -mod=readonly -modcacherw -tags=libsqlite3"
export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build \
		-ldflags "-X github.com/kevinschoon/pomo/pkg/internal.Version=$pkgver" \
		./cmd/pomo
	scdoc <man/pomo.1.scd >pomo.1
}

check() {
	go test ./...
}

package() {
	install -Dm755 pomo -t "$pkgdir"/usr/bin/
	install -Dm644 pomo.1 -t "$pkgdir"/usr/share/man/man1/
}

sha512sums="
53b9608efce6a0820fc9fa3bfb9af406c23f1457bba2113c83b2fe714bff6e6e4d956533691ba7de8ada4db38a37527bed47692524128d275be3ec9a8b9bf758  pomo-0.8.1.tar.gz
"
